﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FileSearcher
{
    public class SearchResult
    {
        public int index;
        public string fileName;//just name without path
        public string filePath;
        public string type;

        public SearchResult(int index, string name, string path)
        {
            if (path == null)
            {
                path = name.Substring(0, name.LastIndexOf(@"\"));
                name = name.Substring(path.Length + 1);
            }
            this.index = index;
            fileName = name;
            filePath = path;
            if (fileName.IndexOf(".") >= 0)
                type = fileName.Substring(fileName.IndexOf("."));
        }

        public object[] GetAllAttributes()
        {
            return new object[] { index, fileName, type, filePath };
        }
    }
}
